package net.topikachu.dynamic.screen.widget;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.el.ELException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;

import com.sun.facelets.FaceletContext;
import com.sun.facelets.FaceletException;

public class CompositeWidget implements Widget {
	private final List<Widget> children = new ArrayList<Widget>();

	public void addChild(Widget w) {
		children.add(w);
	}

	public void apply(FaceletContext ctx, UIComponent parent)
			throws IOException, FacesException, FaceletException, ELException {
		for (Widget widget : children) {
			widget.apply(ctx, parent);
		}

	}

	public Map<String, String> getVariables() {
		return null;
	}

	public FaceletWidget getChild() {
		return null;
	}

}
